<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>TODO supply a title</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <div>
            <table width="90%" border="0" cellpadding="0" cellspacing="2" align="center">
                <tr> 
                    <td colspan="2" height="21" align="center"><h1>产品销售出库单</h1></td>
                </tr>
                <tr> 
                    <td align="left"></td>
                    <td height="21" align="right">
                        {_ $staff_realname=$var.staff_realname}
                        {$var.realname?'客户: '.$var.realname: ''}
                    </td>
                </tr>
                <tr> 
                    <td colspan="2" align="right">
                        出库日期: {date('Y-m-d',$var.time)}&nbsp;&nbsp;打印日期: {date('Y-m-d')}&nbsp;&nbsp;
                    </td>
                </tr>
                <tr>

                    <td colspan="2">

                        <table width="100%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#000000">
                            <tr>

                                <th height="30">货号</th>
                                <th>产品名称</th>
                                <th>数量</th>
                                <th>单位</th>
                                <th>单价</th>
                                <th>折扣</th>
                                <th>金额</th>
                            </tr>
                            {loop $orders as $var}
                            {_ $var.product_data=unserialize($var.product_data);
                            $quantity+=$var.quantity;
                            $amount+=$var.amount;
                            $points+=$var.points;
                            $sales+=$var.product_data.sales;
                            }
                            <tr>

                                <td height="25">{$var.product_data.code}</td>
                                <td>{$var.product_data.name}</td>
                                <td align="center">{$var.quantity}</td>
                                <td align="center">{$var.product_data.unit}</td>
                                <td align="center">{$var.product_data.sales}</td>
                                <td align="center">{$var.discounts}</td>
                                <td align="center">{$var.amount}</td>
                            </tr>
                            {/loop}
                            <tr>
                                <td colspan="6" align="right">合计</td>
                                <td align="center">{$amount}</td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="2" align="center">
                            <tr> 
                                <td height="21" align="left" width="50%">
                                    {$base.company}
                                </td>
                                <td align="right" width="50%">
                                    经办: {$staff_realname}&nbsp;&nbsp;&nbsp;&nbsp;打印: {$member.realname}
                                </td>
                            </tr>
                        </table></td>
                </tr>
            </table>
        </div>
    </body>
</html>
